﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System.Diagnostics;

namespace Auction_Boxing_2
{
    public class StateUseItem : State
    {
        BoxingItem Item;
        float timer = 1f;

        public StateUseItem(State state, BoxingItem Item)
        {
            StateName = "casting";
            this.ATextures = state.StatePlayer.ATextures;
            this.Item = Item;

            LoadState(state.StatePlayer, ATextures);
        }

        public override void LoadState(BoxingPlayer player, Dictionary<string, Animation> ATextures)
        {
            this.StatePlayer = player;
            this.PlayerAnimation = ATextures[StateName];
            StatePlayer.isAttacking = false;
            StatePlayer.isHit = false;
        }

        public override void Initialize()
        {
            // Depricated. Why? Because Lazy.
        }

        public override void HandleMovement()
        {
            Item.HandleMovement();

        }

        public override void HandleDirection()
        {
            Item.HandleDirection(StatePlayer.PlayerEffect);
        }

        public override void Update(GameTime gameTime)
        {
            Item.Update();
        }

        public override void HandleState()
        {
            Item.HandleState();
        }

        public override void Translate(float x, float y)
        {
            // Use TranslateItem and TranslatePlayer in BoxingItem class

        }

        public override void HandleCollision(List<BoxingPlayer> Players)
        {
            Item.HandleCollosion(Players);
        }



    }
}
